package com.foreknow.elm.controller;

import com.foreknow.elm.po.Business;
import com.foreknow.elm.service.BusinessService;
import com.foreknow.elm.service.Impl.BusinessServiceImpl;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public class BusinessController {
    public Object listBusinessByOrderTypeId(HttpServletRequest request){
        BusinessService businessService=new BusinessServiceImpl();
        Integer orderTypeId=Integer.parseInt(request.getParameter("orderTypeId"));
        List<Business> list= businessService.listBusinessByOrderTypeId(orderTypeId);
        return list;
    }
    public Object getBusinessById(HttpServletRequest request) {
        BusinessService businessService=new BusinessServiceImpl();
        Integer businessId=Integer.parseInt(request.getParameter("businessId"));
        Business business=businessService.getBusinessById(businessId);
        return business;
    }
}
